From: Siegfried-Angel Gevatter Pujals Date: Fri, 18 Dec 2009 19:22:51 +0000 (+0100) Subject: Make "gnome-shell --create-extension" compatible with Python 2.5 X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~10599 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=45f4292259672bd21495d9ed45d765b1f0635092;p=gnome-shell.git Make "gnome-shell --create-extension" compatible with Python 2.5 Fallback to using the json-py module on systems with a Python version older than 2.6 (which introduced native JSON support). --- diff --git a/src/gnome-shell.in b/src/gnome-shell.in index 62c86d604..2142c8f02 100644 --- a/src/gnome-shell.in +++ b/src/gnome-shell.in @@ -260,7 +260,11 @@ use an extension title clicktofocus@janedoe.example.com.''' 'description': description, 'uuid': uuid } f = open(os.path.join(extension_path, 'metadata.json'), 'w') - json.dump(meta, f) + try: + json.dump(meta, f) + except AttributeError: + # For Python versions older than 2.6, try using the json-py module + f.write(json.write(meta) + '\n') f.close() extensionjs_path = os.path.join(extension_path, 'extension.js')